//
//  SinaSearchView.swift
//  SinaWeibo(Swift)
//
//  Created by 王忠迪 on 9/22/16.
//  Copyright © 2016 王忠迪. All rights reserved.
//

import UIKit

class SinaSearchView: UIButton {

    //定义一个类方法,加载视图
    class func loadSearchView() -> SinaSearchView {
        
        let nib = UINib(nibName: "SinaSearchView", bundle: nil)
        
        let searchView = nib.instantiate(withOwner: nil, options: nil).last as! SinaSearchView
        
        return searchView
        
    }
        
    override func awakeFromNib() {
        
        self.imageEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 10)
        
        self.imageEdgeInsets = UIEdgeInsetsMake(0, 10, 0, -10)
        
        self.titleEdgeInsets = UIEdgeInsetsMake(0, 15, 0, -10)
        
        self.layer.cornerRadius = 15
        //默认maskToBounds是开启的
//        self.layer.masksToBounds = true
        
        self.bounds.size.width = UIScreen.main.bounds.width
        
        self.bounds.size.height = 32

    }

}
